# Copyright 1999-2006 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header:$ 

inherit kde

DESCRIPTION="KGraphViewer is a GraphViz dot graph viewer for KDE"
HOMEPAGE="https://gna.org/projects/kgraphviewer"
SRC_URI="http://download.gna.org/${PN}/${P//_/}.tar.bz2"

SLOT="0"
LICENSE="GPL-2"
KEYWORDS="amd64 ppc ppc64 sparc x86"

RDEPEND="media-gfx/graphviz"
DEPEND="${RDEPEND} 
		dev-libs/boost
		>=dev-util/scons-0.96.1"

S="$WORKDIR/${P//_/}"

need-kde 3.4

LANGS="en fr"

src_compile() {
	[ -d "$QTDIR/etc/settings" ] && addwrite "$QTDIR/etc/settings"
	addpredict "$QTDIR/etc/settings"

	local myconf="kdeincludes=$(kde-config --prefix)/include prefix=/usr "
	use amd64 && myconf="${myconf} libsuffix=64"

	scons configure ${myconf} || die "configure failed"
	scons ${MAKEOPTS} || die "scons failed"
}

src_install() {
	local LANG_INSTALL="$(echo $(echo "${LINGUAS} ${LANGS}" | fmt -w 1 | sort | uniq -d))"
	scons install DESTDIR="${D}" languages="${LANG_INSTALL}"
	dodoc AUTHORS COPYING INSTALL README
}

